package com.py.credit.controller;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.py.credit.common.logs.ExceptionLogger;
import com.py.credit.common.rest.RestServiceResult;
import com.py.credit.dao.BatchLogDao;
import com.py.credit.dao.RuleCheckingDao;
import com.py.credit.entity.BatchLog;
import com.py.credit.entity.Column;
import com.py.credit.entity.SysUser;
import com.py.credit.entity.Table;
import com.py.credit.entity.common.LogEnum;
import com.py.credit.entity.common.OptionalColumn;
import com.py.credit.entity.enums.YzTestEnum;
import com.py.credit.service.ColumnService;
import com.py.credit.service.DataEntryService;
import com.py.credit.service.RemoteBaseService;
import com.py.credit.service.StepLogService;
import com.py.credit.service.TableService;
import com.py.credit.service.YzTestService;
import com.py.credit.service.excel.read.service.InspectDataStyleService;
import com.py.credit.utils.ExcelUtil;
import com.py.credit.utils.FileUtils;
import com.py.credit.utils.MapCache;
import com.py.credit.utils.UuidUtil;
import com.py.credit.utils.getEnterpriseDataUtil;
import com.py.framework.core.annotation.IgnoreAuthority;
import com.py.framework.core.common.Page;
import com.py.framework.core.helper.HttpServletHelper;

@RestController
@RequestMapping(value = "/yzText")
public class YzTestController {

	private static final String YZTEST = "YzTest";
	@Autowired
	private YzTestService yzTestService;

	@Autowired
	private ThreadPoolTaskExecutor threadPoolTaskExecutor;

	private static final String CHECKREPEAT_NO = "N";

	@Autowired
	private RuleCheckingDao ruleCheckingDao;

	@Autowired
	private RemoteBaseService remoteBaseService;

	@Autowired
	BatchLogDao batchLogDao;

	@Autowired
	private TableService tableService;

	@Autowired
	private ColumnService columnService;

	@Autowired
	@Qualifier("default")
	private InspectDataStyleService inspectDataStyleService;

	@Autowired
	private DataEntryService dataEntryService;

	@Autowired
	private StepLogService stepLogService;
	// 企业裁判文书信息
	private static String qycpwsxx = "/services/query/enterprise/law/entCpwsInfomation";
	// 企业执行公告信息
	private static String qyzxggxx = "/services/query/enterprise/law/entZxggInfomation";
	// 企业失信公告信息
	private static String qysxggxx = "/services/query/enterprise/law/entShixinInfomation";
	// 企业开庭公告信息
	private static String qyktggxx = "/services/query/enterprise/law/entKtggInfomation";
	// 企业法院公告信息
	private static String qyfyggxx = "/services/query/enterprise/law/entFyggInfomation";
	// 企业网贷黑名单信息
	private static String qywdhmdxx = "/services/query/enterprise/law/entWdhmdInfomation";
	// 企业案件流程信息
	private static String qyajlcxx = "/services/query/enterprise/law/entAjlcInfomation";
	// 企业曝光台信息
	private static String qybgtxx = "/services/query/enterprise/law/entBgtInfomation";
	// 企业注册信息
	private static String qyzcxx = "/services/query/enterprise/basic/entBasic";
	// 企业股东及出资信息
	private static String qygdjczxx = "/services/query/enterprise/basic/entShareHolder";
	// 企业主要管理人员信息
	private static String qyzyglryxx = "/services/query/enterprise/basic/entPerson";
	// 企业法定代表人对外投资信息
	private static String qyfddbrdwtzxx = "/services/query/enterprise/basic/entFrinv";
	// 企业法定代表人其他公司任职信息
	private static String qyfddbrqtgsrzxx = "/services/query/enterprise/basic/entFrposition";
	// 企业对外投资信息
	private static String qydwtzxx = "/services/query/enterprise/basic/entEntinv";
	// 企业信息变更
	private static String qyxxbg = "/services/query/enterprise/basic/entAlter";
	// 分支机构信息
	private static String fzjdxx = "/services/query/enterprise/basic/entFiliation";
	// 股权出质历史
	private static String gqczls = "/services/query/enterprise/basic/entSharesimpawn";
	// 动产抵押信息
	private static String dcdyxx = "/services/query/enterprise/basic/entMordetail";
	// 动产抵押物信息
	private static String dcdywxx = "/services/query/enterprise/basic/entMorguainfo";
	// 失信被执行人信息
	private static String sxbzxr = "/services/query/enterprise/basic/entPunishbreak";
	// 被执行人信息
	private static String bzxrxx = "/services/query/enterprise/basic/entPunished";
	// 股权冻结历史信息
	private static String gqdjxx = "/services/query/enterprise/basic/entSharesfrost";
	// 清算信息
	private static String qsxx = "/services/query/enterprise/basic/entLiquidation";
	// 行政处罚历史信息
	private static String xzcflsxx = "/services/query/enterprise/basic/entCaseinfo";
	// 最终控股股东信息
	private static String zzkzgdxx = "/services/query/enterprise/basic/entFinalShareHolder";
	// 税务评级-v2
	private static String swpj = "/services/query/enterprise/v2/entTaxCredit";
	// 网站备案-v2
	private static String wzba = "/services/query/enterprise/v2/entIcp";
	// 商标信息-v2
	private static String sbxx = "/services/query/enterprise/v2/entLogo";
	// 专利-v2
	private static String zl = "/services/query/enterprise/v2/entPatent";
	// 欠税公告-v2
	private static String qsgg = "/services/query/enterprise/v2/entTaxNotice";

	@IgnoreAuthority
	@RequestMapping(value = "/selectbeijingDate.json")
	public RestServiceResult<JSONObject> insertBeijingDate(@RequestParam(value = "file") CommonsMultipartFile file,
			HttpServletRequest request) throws IOException {
		// 批次号
		String logBatchId = UuidUtil.getInstance().getUUid();
		// 每次采集先假删除日记数据
		// yzTestService.updateLog();
		RestServiceResult<JSONObject> result = new RestServiceResult<>();
		StringBuilder error = new StringBuilder();
		JSONObject jb = new JSONObject();
		Sheet readExcelFileForSheet = readExcelFileForSheet(file.getInputStream());
		// 获取上传文件的企业名称和统一社会信用编码
		List<Map<String, Object>> qyNameList = addRecordsFromSheet(readExcelFileForSheet);
		// 获取当前用户信息
		String token = HttpServletHelper.getUserToken(request);
		RestServiceResult<SysUser> user = remoteBaseService.getCurrentUser(token);
		SysUser userInfo = new SysUser();
		if (RestServiceResult.CODE_SUCCESS == user.getCode()) {
			userInfo = user.getData();
			if (null == userInfo || userInfo.getId() <= 0) {
				result.setCode(RestServiceResult.CODE_UNKNOW);
				result.setMsg("系统异常，请稍后再试！");
				ExceptionLogger.error("BatchLogController#getBatchDetail", "未获取到当前用户信息！");
				return result;
			}
		} else {
			result.setCode(user.getCode());
			result.setMsg(user.getMsg());
			return result;
		}
		// 56库中30张表的id
		// String
		// strId="210110,210100,210098,210097,210101,210099,210103,210102,210104,210013,210012,210011,210085,210087,210083,210008,210009,210088,210091,210096,210111,210095,210093,210094,210092,210089,210107,210108,210105,210106,210109";
		// 适用于56库扬州报告的一些表
		// String
		// strId="210100,210098,210097,210101,210099,210103,210013,210012,210011,210085,210083,210008,210009,210096,210095,210092,210107,210108,210105,210106,210109";
		// 适用于脚本出扬州报告的一些表
		String strId = "300002,300003,300004,300005,300006,300007,300008,300009,300010,300011,300012,300013,300014,300015,300016,300017,210013,210011,210012,210009,210008";
		final List<String> idList = java.util.Arrays.asList(strId.split(","));
		if (!CollectionUtils.isEmpty(qyNameList)) {
			final long deptId = userInfo.getOfficeId();
			final long id = userInfo.getId();
			threadPoolTaskExecutor.execute(new Runnable() {
				@Override
				public void run() {
					for (int j = 0; j < qyNameList.size(); ++j) {
						for (int i = 0; i < idList.size(); ++i) {
							String tableId = idList.get(i);
							String url = "";
							url = selectUrlById(tableId);
							String kId = "100000";
							String entName = "entNameOrEntCode";
							String data = null;
							try {
								// 获取北京接口数据
								data = getEnterpriseDataUtil.getEntInfo(url, entName,
										String.valueOf(qyNameList.get(j).get("name")), null);
								// data="{\"code\":10,\"msg\":10,\"timeOutFlag\":null,\"systemDataDate\":null,\"data\":[{\"esDate\":\"2016-01-12\",\"industryConame\":\"首饰、工艺品及收藏品批发\",\"abuItem\":\"书画作品（不含需前置审批项目）、工艺美术品、文化用品（不含图书、音像制品）、办公用品销售；文化艺术交流活动组织策划；展览展示服务；会议服务；非学历、非职业技能、非职业证书培训。（依法须经批准的项目，经相关部门批准后方可开展经营活动）\",\"frName\":\"曹国生\",\"canDate\":\"\",\"opScope\":\"书画作品（不含需前置审批项目）、工艺美术品、文化用品（不含图书、音像制品）、办公用品销售；文化艺术交流活动组织策划；展览展示服务；会议服务；非学历、非职业技能、非职业证书培训。（依法须经批准的项目，经相关部门批准后方可开展经营活动）\",\"entNameEng\":\"扬州市鼎丰书画院\",\"opFrom\":\"2016-01-12\",\"opTo\":\"长期\",\"revDate\":\"\",\"dom\":\"扬子江中路289号（财富广场）2-101\",\"regOrg\":\"扬州经济技术开发区市场监督管理局\",\"tel\":\"13805275028\",\"oriregNo\":\"\",\"regCapcur\":\"人民币元\",\"industryPhy\":\"F\",\"entType\":\"个人独资企业\",\"entName\":\"扬州市鼎丰书画院\",\"opScoAndForm\":\"书画作品（不含需前置审批项目）、工艺美术品、文化用品（不含图书、音像制品）、办公用品销售；文化艺术交流活动组织策划；展览展示服务；会议服务；非学历、非职业技能、非职业证书培训。（依法须经批准的项目，经相关部门批准后方可开展经营活动）\",\"ancheDate\":\"\",\"entStatus\":\"在营（开业）\",\"cbuItem\":\"书画作品（不含需前置审批项目）、工艺美术品、文化用品（不含图书、音像制品）、办公用品销售；文化艺术交流活动组织策划；展览展示服务；会议服务；非学历、非职业技能、非职业证书培训。（依法须经批准的项目，经相关部门批准后方可开展经营活动）\",\"industryCoAll\":\"5146首饰、工艺品及收藏品批发\",\"industryPhyAll\":\"F批发和零售业\",\"industryCocode\":\"5146\",\"empNum\":\"2\",\"regOrgProvince\":\"江苏省\",\"zsopScope\":\"书画作品（不含需前置审批项目）、工艺美术品、文化用品（不含图书、音像制品）、办公用品销售；文化艺术交流活动组织策划；展览展示服务；会议服务；非学历、非职业技能、非职业证书培训。（依法须经批准的项目，经相关部门批准后方可开展经营活动）\",\"regOrgCode\":\"321091\",\"regCap\":\"100.000000\",\"ancheYear\":\"2017\",\"creditCode\":\"91321091MA1MEB224B\",\"regNo\":\"321091000082898\",\"recCap\":\"100.000000\",\"industryPhyname\":\"批发和零售业\"}]}";
							} catch (Exception e) {
								ExceptionLogger.error("YzTestController#getEntInfo", "调用北京接口异常！ERROR:" + url
										+ String.valueOf(qyNameList.get(j).get("name")) + e.getMessage(), e);
								// 捕获抛出的异常
								error.append(url + e.getMessage());
								jb.put(url, e.getMessage());
							}
							try {
								JSONObject mapTypes = JSONObject.parseObject(data);
								if ("0".equals(mapTypes.get("code").toString())) {
									// 入库数据
									manualCollection(data, Integer.valueOf(tableId), Integer.valueOf(kId), deptId, id,
											String.valueOf(qyNameList.get(j).get("name")),
											String.valueOf(qyNameList.get(j).get("tybm")));
								} else {
									// 根据表id查询表名称
									String tableName = yzTestService.selectTableNameByTableId(tableId);
									// 生成接口错误异常日记
									yzTestService.insertLog(String.valueOf(qyNameList.get(j).get("name")),
											String.valueOf(qyNameList.get(j).get("tybm")), tableName, tableId, url,
											mapTypes.get("code").toString(), String.valueOf(mapTypes.get("msg")),
											logBatchId);
								}
							} catch (Exception e) {
								ExceptionLogger.error("YzTestController#manualCollection",
										"接口采集执行异常！ERROR:" + e.getMessage(), e);
								result.setCode(RestServiceResult.CODE_UNKNOW);
								result.setMsg("接口采集执行异常！");
							}
						}
					}
				}

			});
		}
		result.setMsg(String.valueOf(error));
		result.setData(jb);
		return result;
	}

	@Transactional
	public void manualCollection(String data, Integer tableId, Integer rootId, long deptId, long id,
			String entNameOrEntCode, String tybm) {
		StringBuilder error = new StringBuilder();
		// 获取数据表信息
		Table table = tableService.queryCubeById(tableId);
		// 获取数据表列信息
		List<Column> columns = columnService.getListByTableId(tableId);
		String batchId = UuidUtil.getInstance().getUUid();
		// 新增批次信息
		batchLogDao.addBatchLog(batchId.toString(), tableId, "1", rootId, deptId, id, LogEnum.CLZ, null);
		// 获取批次详细信息
		BatchLog batchLog = batchLogDao.select(batchId);
		// List<Map<String, Object>> listDataMap = JSONObject.parseObject(data,
		// new TypeReference<List<Map<String, Object>>>() {
		// });
		List<Map<String, Object>> listDataMap = JsonToListMap(data, entNameOrEntCode, String.valueOf(tableId), tybm);
		int lastSize = listDataMap.size();
		// 处理流程日志
		stepLogService.addStepLog(batchId, "解析接口采集到的" + lastSize + "条数据。");
		// 重复性校验
		stepLogService.addStepLog(batchId, "开始重复性校验：0到" + lastSize + "行数据。");

		// 数据是否需要重复性校验
		boolean checkRepeat = true;
		if (CHECKREPEAT_NO.equals(table.getRepeatCheck())) {
			checkRepeat = false;
		}
		// 数据重复性校验
		Map<String, Object> duplicationCheck = inspectDataStyleService.duplicationCheck(listDataMap, table, columns,
				false, checkRepeat);
		String duplicationMess = String.valueOf(duplicationCheck.get("duplicationMess"));
		// if (null != duplicationCheck &&
		// StringUtils.isNotEmpty(duplicationMess)) {
		// error.append(duplicationMess);
		// // 通过抛出异常执行回滚
		// throw new ServiceException(error.toString());
		// }
		listDataMap = (List<Map<String, Object>>) duplicationCheck.get("listDataMap");
		List<Map<String, Object>> listDataMap2 = (List<Map<String, Object>>) JSONArray.parse(JSONArray.toJSONString(listDataMap));
		int size = listDataMap.size();
		stepLogService.addStepLog(batchId, "开始校验接口采集的0到" + size + "行数据");
		// 数据格式校验
		Map<String, Object> styleCheck = inspectDataStyleService.styleCheck(batchLog, listDataMap, table, columns,listDataMap2);


		// String styleMess = String.valueOf(styleCheck.get("mess"));
		// if (null != styleCheck && StringUtils.isNotEmpty(styleMess)) {
		// error.append(styleMess);
		// // 通过抛出异常执行回滚
		// throw new ServiceException(error.toString());
		// }
		listDataMap = (List<Map<String, Object>>) styleCheck.get("listDataMap");
		size = listDataMap.size();
		stepLogService.addStepLog(batchId, "开始将接口采集的0到" + size + "行数据录入至清洗库。");
		dataEntryService.addSuccessData(listDataMap, table, batchLog, columns);
		stepLogService.addStepLog(batchId, "结束将接口采集的0到" + size + "行数据录入至清洗库。");
		// 通过抛出异常执行回滚
		// if (StringUtils.isNotEmpty(error)) {
		// throw new ServiceException(error.toString());
		// } else {
		// 未异常更新本次数据数量
		int errorCount = Integer
				.parseInt(null != styleCheck.get("errorCount") ? String.valueOf(styleCheck.get("errorCount")) : "0");
		int duplicationCount = Integer.parseInt(null != duplicationCheck.get("duplicationCount")
				? String.valueOf(duplicationCheck.get("duplicationCount")) : "0");
		batchLogDao.modifyBatchLog(batchId, LogEnum.EX_RESULT_S, size, lastSize - errorCount - duplicationCount,
				errorCount, duplicationCount, 0, LogEnum.YWC);
		// }
	}

	/**
	 * 北京数据转换成List<Map<String,Object>>
	 * 
	 * @param date
	 * @return
	 */
	public List<Map<String, Object>> JsonToListMap(String date, String entNameOrEntCode, String tableId, String tybm) {
		JSONObject mapTypes = JSONObject.parseObject(date);
		if ("0".equals(mapTypes.get("code").toString())) {
			JSONArray mapdate = (JSONArray) mapTypes.get("data");
			List<Map<String, Object>> dataList = new ArrayList<Map<String, Object>>();
			if (mapdate.size() > 0) {
				for (int i = 0; i < mapdate.size(); i++) {
					Map<String, Object> dataMap = new HashMap<String, Object>();
					JSONObject job = mapdate.getJSONObject(i);
					for (Map.Entry<String, Object> entry : job.entrySet()) {
						String key = entry.getKey();
						String value = null;
						String str = "";
						if ("".equals(String.valueOf(entry.getValue()))
								|| "null".equals(String.valueOf(entry.getValue()))) {
							str = "";
						} else {
							str = String.valueOf(entry.getValue());
						}
						if (StringUtils.isNotBlank(str)) {
							if (!entry.getValue().getClass().equals(JSONArray.class)) {
								value = (String) entry.getValue();
								dataMap.put(key, value);
							}
						}
					}
					// 企业裁判文书信息
					if ("300002".equals(tableId)) {
						dataList.add(addMap1(entNameOrEntCode, dataMap, tybm));
					}
					// 企业执行公告信息
					if ("300003".equals(tableId)) {
						dataList.add(addMap2(entNameOrEntCode, dataMap, tybm));
					}
					// 企业失信公告信息
					if ("300004".equals(tableId)) {
						dataList.add(addMap3(entNameOrEntCode, dataMap, tybm));
					}
					// 企业开庭公告信息
					if ("300005".equals(tableId)) {
						dataList.add(addMap4(entNameOrEntCode, dataMap, tybm));
					}
					// 企业法院公告信息
					if ("300006".equals(tableId)) {
						dataList.add(addMap5(entNameOrEntCode, dataMap, tybm));
					}
					// 企业网贷黑名单信息
					if ("300007".equals(tableId)) {
						dataList.add(addMap6(entNameOrEntCode, dataMap, tybm));
					}
					// 企业案件流程信息
					if ("210102".equals(tableId)) {
						dataList.add(addMap7(entNameOrEntCode, dataMap, tybm));
					}
					// 企业曝光台信息
					if ("210104".equals(tableId)) {
						dataList.add(addMap8(entNameOrEntCode, dataMap, tybm));
					}
					// 工商基础信息 企业注册信息
					if ("210013".equals(tableId)) {
						dataList.add(addMap9(entNameOrEntCode, dataMap, tybm));
					}
					// 基本信息 企业注册信息
					if ("210110".equals(tableId)) {
						dataList.add(addMap(entNameOrEntCode, dataMap, tybm));
					}
					// 企业股东及出资信息
					if ("210012".equals(tableId)) {
						dataList.add(addMap10(entNameOrEntCode, dataMap, tybm));
					}
					// 企业主要管理人员信息
					if ("210011".equals(tableId)) {
						dataList.add(addMap11(entNameOrEntCode, dataMap, tybm));
					}
					// 企业法定代表人对外投资信息
					if ("300008".equals(tableId)) {
						dataList.add(addMap12(entNameOrEntCode, dataMap, tybm));
					}
					// 企业法定代表人其他公司任职信息
					if ("210087".equals(tableId)) {
						dataList.add(addMap13(entNameOrEntCode, dataMap, tybm));
					}
					// 企业对外投资信息
					if ("300009".equals(tableId)) {
						dataList.add(addMap14(entNameOrEntCode, dataMap, tybm));
					}
					// 企业信息变更
					if ("210008".equals(tableId)) {
						dataList.add(addMap15(entNameOrEntCode, dataMap, tybm));
					}
					// 分支机构信息
					if ("210009".equals(tableId)) {
						dataList.add(addMap16(entNameOrEntCode, dataMap, tybm));
					}
					// 股权出质历史
					if ("210088".equals(tableId)) {
						dataList.add(addMap17(entNameOrEntCode, dataMap, tybm));
					}
					// 动产抵押信息
					if ("210091".equals(tableId)) {
						dataList.add(addMap18(entNameOrEntCode, dataMap, tybm));
					}
					// 失信被执行人信息
					if ("300010".equals(tableId)) {
						dataList.add(addMap19(entNameOrEntCode, dataMap, tybm));
					}
					// 动产抵押物信息
					if ("210111".equals(tableId)) {
						dataList.add(addMap20(entNameOrEntCode, dataMap, tybm));
					}
					// 被执行人信息
					if ("300011".equals(tableId)) {
						dataList.add(addMap21(entNameOrEntCode, dataMap, tybm));
					}
					// 股权冻结历史信息
					if ("210093".equals(tableId)) {
						dataList.add(addMap22(entNameOrEntCode, dataMap, tybm));
					}
					// 清算信息
					if ("210094".equals(tableId)) {
						dataList.add(addMap23(entNameOrEntCode, dataMap, tybm));
					}
					// 行政处罚历史信息
					if ("300012".equals(tableId)) {
						dataList.add(addMap24(entNameOrEntCode, dataMap, tybm));
					}
					// 最终控股股东信息
					if ("210089".equals(tableId)) {
						dataList.add(addMap25(entNameOrEntCode, dataMap, tybm));
					}
					// 税务评级-v2
					if ("300013".equals(tableId)) {
						dataList.add(addMap26(entNameOrEntCode, dataMap, tybm));
					}
					// 网站备案-v2
					if ("300014".equals(tableId)) {
						dataList.add(addMap27(entNameOrEntCode, dataMap, tybm));
					}
					// 商标信息-v2
					if ("300015".equals(tableId)) {
						dataList.add(addMap28(entNameOrEntCode, dataMap, tybm));
					}
					// 专利-v2
					if ("300016".equals(tableId)) {
						dataList.add(addMap29(entNameOrEntCode, dataMap, tybm));
					}
					// 欠税公告-v2
					if ("300017".equals(tableId)) {
						dataList.add(addMap30(entNameOrEntCode, dataMap, tybm));
					}
				}
			}
			return dataList;
		}

		return null;
	}

	/**
	 * 处理企业裁判文书信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap1(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("sjsj",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("wslx", mapList.get("caseType"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("aybm", mapList.get("anyou"));
			mapResult.put("bt", mapList.get("title"));
			mapResult.put("spy", mapList.get("judge"));
			mapResult.put("ah", mapList.get("caseNo"));
			mapResult.put("spjg", mapList.get("judgeResult"));
			mapResult.put("slcx", mapList.get("trialProcedure"));
			mapResult.put("ay", mapList.get("caseCause"));
			mapResult.put("aybmlx", mapList.get("anyouType"));
			mapResult.put("yj", mapList.get("yiju"));
			mapResult.put("fydj", mapList.get("courtRank"));
			return mapResult;
		}
		return mapResult;
	}

	/**
	 * 处理企业执行公告信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap2(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("bzxrxm", mapList.get("pname"));
			mapResult.put("lasj",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("ah", mapList.get("caseNo"));
			mapResult.put("zxbd", mapList.get("execMoney"));
			mapResult.put("bt", mapList.get("title"));
			mapResult.put("sqr", mapList.get("proposer"));
			mapResult.put("ajzt", mapList.get("caseState"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("zhjgdm", mapList.get("idcardNo"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业失信公告信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap3(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("bzxrxm", mapList.get("pname"));
			mapResult.put("lasj",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("ah", mapList.get("caseNo"));
			mapResult.put("lxqk", mapList.get("lxqk"));
			mapResult.put("xb", mapList.get("sex"));
			mapResult.put("nl", mapList.get("age"));
			mapResult.put("zzjgdm", mapList.get("idcardNo"));
			mapResult.put("xgdsr", mapList.get("relatedParty"));
			mapResult.put("yjah", mapList.get("yjCode"));
			mapResult.put("yjdw", mapList.get("yjdw"));
			mapResult.put("jtqk", mapList.get("jtqx"));
			mapResult.put("flyw", mapList.get("yiwu"));
			mapResult.put("sf", mapList.get("province"));
			mapResult.put("fbsj",
					"长期".equals(String.valueOf(mapList.get("postTime"))) ? "2099-01-01" : mapList.get("postTime"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业开庭公告信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap4(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("ktsj",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("yg", mapList.get("plaintiff"));
			mapResult.put("zzz", mapList.get("organizer"));
			mapResult.put("ftmc", mapList.get("courtroom"));
			mapResult.put("xgdsr", mapList.get("relatedParty"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("dsr", mapList.get("party"));
			mapResult.put("bt", mapList.get("title"));
			mapResult.put("ay", mapList.get("caseCause"));
			mapResult.put("fg", mapList.get("judge"));
			mapResult.put("ah", mapList.get("caseNo"));
			mapResult.put("bg", mapList.get("defendant"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业法院公告信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap5(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("fbsj",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("xm", mapList.get("pname"));
			mapResult.put("xgdsr", mapList.get("relatedParty"));
			mapResult.put("bm", mapList.get("layout"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("gglx", mapList.get("ggType"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业网贷黑名单信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap6(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("dksj",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("xb", mapList.get("sex"));
			mapResult.put("jzdh", mapList.get("phone"));
			mapResult.put("xxgxsj",
					"长期".equals(String.valueOf(mapList.get("updateTim"))) ? "2099-01-01" : mapList.get("updateTim"));
			mapResult.put("zxfy", mapList.get("execCourt"));
			mapResult.put("xm", mapList.get("pname"));
			mapResult.put("xgdsr", mapList.get("relatedParty"));
			mapResult.put("wh", mapList.get("whfx"));
			mapResult.put("sfz", mapList.get("idcardNo"));
			mapResult.put("jgdz", mapList.get("birthPlac"));
			mapResult.put("yxdz", mapList.get("email"));
			mapResult.put("jzdz", mapList.get("address"));
			mapResult.put("lydwmc", mapList.get("sourceName"));
			mapResult.put("bj", mapList.get("bjbx"));
			mapResult.put("ah", mapList.get("caseCode"));
			mapResult.put("sjh", mapList.get("mobile"));
			mapResult.put("yh", mapList.get("yhje"));
			mapResult.put("nl", mapList.get("age"));
			mapResult.put("sjy", mapList.get("datasource"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业案件流程信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap7(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("ftcy", mapList.get("member"));
			mapResult.put("larq",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("dzydh", mapList.get("clerkPhon"));
			mapResult.put("ajlb", mapList.get("caseType"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("slcx", mapList.get("trialProcedure"));
			mapResult.put("pjrq", "长期".equals(String.valueOf(mapList.get("sentencingDate"))) ? "2099-01-01"
					: mapList.get("sentencingDate"));
			mapResult.put("zxzt", mapList.get("status"));
			mapResult.put("ajzt", mapList.get("caseStatus"));
			mapResult.put("zzz", mapList.get("organizer"));
			mapResult.put("gdrq",
					"长期".equals(String.valueOf(mapList.get("filingDate"))) ? "2099-01-01" : mapList.get("filingDate"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("slzt", mapList.get("ajlcStatus"));
			mapResult.put("zyfg", mapList.get("chiefJudge"));
			mapResult.put("ay", mapList.get("caseCause"));
			mapResult.put("spxzrq", "长期".equals(String.valueOf(mapList.get("trialLimitDate"))) ? "2099-01-01"
					: mapList.get("trialLimitDate"));
			mapResult.put("sjy", mapList.get("clerk"));
			mapResult.put("fg", mapList.get("judge"));
			mapResult.put("ssbd", mapList.get("actionObject"));
			mapResult.put("dsr", mapList.get("pname"));
			mapResult.put("ah", mapList.get("caseNo"));
			mapResult.put("yxrq", "长期".equals(String.valueOf(mapList.get("effectiveDate"))) ? "2099-01-01"
					: mapList.get("effectiveDate"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业曝光台信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap8(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("bgtid", mapList.get("bgtId"));
			mapResult.put("larq",
					"长期".equals(String.valueOf(mapList.get("sortTime"))) ? "2099-01-01" : mapList.get("sortTime"));
			mapResult.put("fymc", mapList.get("court"));
			mapResult.put("dsr", mapList.get("pname"));
			mapResult.put("sqr", mapList.get("proposer"));
			mapResult.put("dsrlx", mapList.get("partyType"));
			mapResult.put("ztbm", mapList.get("idcardNo"));
			mapResult.put("nr", mapList.get("body"));
			mapResult.put("bgrq",
					"长期".equals(String.valueOf(mapList.get("bgDate"))) ? "2099-01-01" : mapList.get("bgDate"));
			mapResult.put("ay", mapList.get("caseCause"));
			mapResult.put("ah", mapList.get("caseNo"));
			mapResult.put("bdje", mapList.get("execMoney"));
			mapResult.put("wzxje", mapList.get("unnexeMoney"));
			mapResult.put("dz", mapList.get("address"));
			mapResult.put("yj", mapList.get("yiju"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业注册信息 工商基础信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap9(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", mapList.get("creditCode"));
			mapResult.put("A000003", mapList.get("regNo"));
			mapResult.put("dmlx", mapList.get("entType"));
			mapResult.put("FDDBR", mapList.get("frName"));
			mapResult.put("ZCZB", mapList.get("regCap"));
			mapResult.put("ZCZBBZ", mapList.get("regCapcur"));
			mapResult.put("CLRQ",
					"长期".equals(String.valueOf(mapList.get("esDate"))) ? "2099-01-01" : mapList.get("esDate"));
			mapResult.put("YYQS",
					"长期".equals(String.valueOf(mapList.get("opFrom"))) ? "2099-01-01" : mapList.get("opFrom"));
			mapResult.put("YYQZ",
					"长期".equals(String.valueOf(mapList.get("opTo"))) ? "2099-01-01" : mapList.get("opTo"));
			mapResult.put("DJJG", mapList.get("regOrg"));
			mapResult.put("ZS", mapList.get("dom"));
			mapResult.put("JYFW", mapList.get("opScope"));
			mapResult.put("HYDM", mapList.get("industryPhyname"));
			mapResult.put("DJZT", mapList.get("entStatus"));

			mapResult.put("zxrq",
					"长期".equals(String.valueOf(mapList.get("canDate"))) ? "2099-01-01" : mapList.get("canDate"));
			mapResult.put("ygrs", mapList.get("empNum"));
			mapResult.put("lxdh", mapList.get("tel"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业注册信息 基本信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", mapList.get("creditCode"));
			mapResult.put("fddbrxm", mapList.get("frName"));
			mapResult.put("zch", mapList.get("regNo"));
			mapResult.put("zczb", mapList.get("regCap"));
			mapResult.put("bz", mapList.get("regCapcur"));
			mapResult.put("kyrq",
					"长期".equals(String.valueOf(mapList.get("esDate"))) ? "2099-01-01" : mapList.get("esDate"));
			mapResult.put("jyqxzc",
					"长期".equals(String.valueOf(mapList.get("opFrom"))) ? "2099-01-01" : mapList.get("opFrom"));
			mapResult.put("jyqxzz",
					"长期".equals(String.valueOf(mapList.get("opTo"))) ? "2099-01-01" : mapList.get("opTo"));
			mapResult.put("qylxzd", mapList.get("entType"));
			mapResult.put("jyzt", mapList.get("entStatus"));
			mapResult.put("zxrq",
					"长期".equals(String.valueOf(mapList.get("canDate"))) ? "2099-01-01" : mapList.get("canDate"));
			mapResult.put("dxrq",
					"长期".equals(String.valueOf(mapList.get("revDate"))) ? "2099-01-01" : mapList.get("revDate"));
			mapResult.put("yzch", mapList.get("oriregNo"));
			mapResult.put("zz", mapList.get("dom"));
			mapResult.put("xkjyxm", mapList.get("abuItem"));
			mapResult.put("ybjyxm", mapList.get("cbuItem"));
			mapResult.put("jyfw", mapList.get("opScope"));
			mapResult.put("jyfwjfs", mapList.get("opScoAndForm"));
			mapResult.put("djjg", mapList.get("regOrg"));
			mapResult.put("zhnjnd", mapList.get("ancheYear"));
			mapResult.put("sszb", mapList.get("recCap"));
			mapResult.put("hymdm", mapList.get("industryPhy"));
			mapResult.put("hymlmc", mapList.get("industryPhyname"));
			mapResult.put("gmjjhydm", mapList.get("industryCocode"));
			mapResult.put("zhnjrq", mapList.get("ancheDate"));
			mapResult.put("zcdsf", mapList.get("regOrgProvince"));
			mapResult.put("gmjjhymc", mapList.get("industryConame"));
			mapResult.put("jyywfw", mapList.get("zsopScope"));
			mapResult.put("hymldmjmc", mapList.get("industryPhyAll"));
			mapResult.put("gmjjhydmjmc", mapList.get("industryCoAll"));
			mapResult.put("ygrs", mapList.get("empNum"));
			mapResult.put("qyywmc", mapList.get("entNameEng"));
			mapResult.put("lxdh", mapList.get("tel"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业股东及出资信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap10(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("DP", mapList.get("shaName"));
			mapResult.put("SCCA", mapList.get("subCoNam"));
			mapResult.put("GDLX", mapList.get("invType"));
			mapResult.put("SHRATIO", mapList.get("fundEdratio"));
			mapResult.put("SCDATE",
					"长期".equals(String.valueOf(mapList.get("conDate"))) ? "2099-01-01" : mapList.get("conDate"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业主要管理人员信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap11(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("XM", mapList.get("perName"));
			mapResult.put("ZW", mapList.get("position"));
			mapResult.put("XB", mapList.get("sex"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业法定代表人对外投资信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap12(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("fddbrxm", mapList.get("name"));
			mapResult.put("frdwtzqymc", mapList.get("entName"));
			mapResult.put("frdwtzzch", mapList.get("regNo"));
			mapResult.put("qylx", mapList.get("entType"));
			mapResult.put("zczj", mapList.get("regCap"));
			mapResult.put("zcbz", mapList.get("regCapcur"));
			mapResult.put("qyzt", mapList.get("entStatus"));
			mapResult.put("zxrq",
					"长期".equals(String.valueOf(mapList.get("canDate"))) ? "2099-01-01" : mapList.get("canDate"));
			mapResult.put("dxrq",
					"长期".equals(String.valueOf(mapList.get("revDate"))) ? "2099-01-01" : mapList.get("revDate"));
			mapResult.put("djjg", mapList.get("regOrg"));
			mapResult.put("rjcze", mapList.get("subConam"));
			mapResult.put("rjczbz", mapList.get("currency"));
			mapResult.put("czfs", mapList.get("conform"));
			mapResult.put("czbl", mapList.get("fundedRatio"));
			mapResult.put("kyrq",
					"长期".equals(String.valueOf(mapList.get("esDate"))) ? "2099-01-01" : mapList.get("esDate"));
			mapResult.put("qyzsl", mapList.get("pinvAmount"));
			mapResult.put("zcdzxzbh", mapList.get("regOrgCode"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业法定代表人其他公司任职信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap13(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("fddbrxm", mapList.get("name"));
			mapResult.put("rzqymc", mapList.get("entName"));
			mapResult.put("rzqyzch", mapList.get("regNo"));
			mapResult.put("rzqylx", mapList.get("entType"));
			mapResult.put("zczb", mapList.get("regCap"));
			mapResult.put("zczbbz", mapList.get("regCapcur"));
			mapResult.put("qyzt", mapList.get("entStatus"));
			mapResult.put("zxrq",
					"长期".equals(String.valueOf(mapList.get("canDate"))) ? "2099-01-01" : mapList.get("canDate"));
			mapResult.put("dxrq",
					"长期".equals(String.valueOf(mapList.get("revDate"))) ? "2099-01-01" : mapList.get("revDate"));
			mapResult.put("djjg", mapList.get("regOrg"));
			mapResult.put("zw", mapList.get("position"));
			mapResult.put("sffddbr", mapList.get("lepersign"));
			mapResult.put("kyrq",
					"长期".equals(String.valueOf(mapList.get("esDate"))) ? "2099-01-01" : mapList.get("esDate"));
			mapResult.put("qyzsl", mapList.get("ppvAmount"));
			mapResult.put("zcdzxzqbh", mapList.get("regOrgCode"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业对外投资信息
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap14(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("btzqymc", mapList.get("entName"));
			mapResult.put("btzqyzch", mapList.get("regNo"));
			mapResult.put("btzqylx", mapList.get("entType"));
			mapResult.put("zczj", mapList.get("regCap"));
			mapResult.put("zczjbz", mapList.get("regCapcur"));
			mapResult.put("qyzt", mapList.get("entStatus"));
			mapResult.put("zxrq",
					"长期".equals(String.valueOf(mapList.get("canDate"))) ? "2099-01-01" : mapList.get("canDate"));
			mapResult.put("dxrq",
					"长期".equals(String.valueOf(mapList.get("revDate"))) ? "2099-01-01" : mapList.get("revDate"));
			mapResult.put("djjg", mapList.get("regOrg"));
			mapResult.put("rjcze", mapList.get("subConam"));
			mapResult.put("rjczbz", mapList.get("congrocur"));
			mapResult.put("czfs", mapList.get("conform"));
			mapResult.put("czbl", mapList.get("fundedRatio"));
			mapResult.put("fddbrxm", mapList.get("name"));
			mapResult.put("qyzsl", mapList.get("binvvAmount"));
			mapResult.put("zcdzxzqbh", mapList.get("regOrgCode"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理企业信息变更
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap15(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("BGSX", mapList.get("altitem"));
			mapResult.put("BGQNR", mapList.get("altbe"));
			mapResult.put("BGHNR", mapList.get("altaf"));
			mapResult.put("BGRQ",
					"长期".equals(String.valueOf(mapList.get("altdate"))) ? "2099-01-01" : mapList.get("altdate"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理分支机构信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap16(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("QYMC", mapList.get("brname"));
			mapResult.put("TYXYDM", mapList.get("brregno"));
			mapResult.put("FZR", mapList.get("brprincipal"));
			mapResult.put("JYFW", mapList.get("cbuitem"));
			mapResult.put("ZS", mapList.get("braddr"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理股权出质历史数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap17(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("zqrxm", mapList.get("imporg"));
			mapResult.put("czrlb", mapList.get("imporgtype"));
			mapResult.put("czje", mapList.get("impam"));
			mapResult.put("czbarq", "长期".equals(String.valueOf(mapList.get("imponrecdate"))) ? "2099-01-01"
					: mapList.get("imponrecdate"));
			mapResult.put("czspbm", mapList.get("impexaeep"));
			mapResult.put("czpzrq",
					"长期".equals(String.valueOf(mapList.get("impsandate"))) ? "2099-01-01" : mapList.get("impsandate"));
			mapResult.put("czjzrq",
					"长期".equals(String.valueOf(mapList.get("impto"))) ? "2099-01-01" : mapList.get("impto"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理动产抵押信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap18(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("dyid", mapList.get("morreg_id"));
			mapResult.put("dyr", mapList.get("mortgagor"));
			mapResult.put("dyqr", mapList.get("more"));
			mapResult.put("djjg", mapList.get("regorg"));
			mapResult.put("djrq",
					"长期".equals(String.valueOf(mapList.get("regidate"))) ? "2099-01-01" : mapList.get("regidate"));
			mapResult.put("ztbs", mapList.get("mortype"));
			mapResult.put("djzh", mapList.get("morregcno"));
			mapResult.put("sqdyyy", mapList.get("appregrea"));
			mapResult.put("bdbzzqzl", mapList.get("priclaseckind"));
			mapResult.put("bdbzzqse", mapList.get("priclasecam"));
			mapResult.put("lyqsrq",
					"长期".equals(String.valueOf(mapList.get("pefperform"))) ? "2099-01-01" : mapList.get("pefperform"));
			mapResult.put("lyjzrq",
					"长期".equals(String.valueOf(mapList.get("pefperto"))) ? "2099-01-01" : mapList.get("pefperto"));
			mapResult.put("zxrq",
					"长期".equals(String.valueOf(mapList.get("candate"))) ? "2099-01-01" : mapList.get("candate"));
			mapResult.put("zcdzxzqbh", mapList.get("regOrgCode"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理动产抵押物品信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap19(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("morreg_id", mapList.get("morreg_id"));
			mapResult.put("guaname", mapList.get("guaname"));
			mapResult.put("quan", mapList.get("quan"));
			mapResult.put("value", mapList.get("value"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理失信被执行人信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap20(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("ah", mapList.get("caseCode"));
			mapResult.put("bzxrxm", mapList.get("iname"));
			mapResult.put("sxrlx", mapList.get("type"));
			mapResult.put("xb", mapList.get("sexy"));
			mapResult.put("bzxrbm", mapList.get("cardnum"));
			mapResult.put("sfzysfd", mapList.get("ysfzd"));
			mapResult.put("fdrxm", mapList.get("businessEntity"));
			mapResult.put("lasj",
					"长期".equals(String.valueOf(mapList.get("regDate"))) ? "2099-01-01" : mapList.get("regDate"));
			mapResult.put("gbsj", "长期".equals(String.valueOf(mapList.get("publishDate"))) ? "2099-01-01"
					: mapList.get("publishDate"));
			mapResult.put("zxfy", mapList.get("courtName"));
			mapResult.put("sf", mapList.get("areaName"));
			mapResult.put("zxyjwh", mapList.get("gistid"));
			mapResult.put("zczxyjdw", mapList.get("gistunit"));
			mapResult.put("sxflwsqdyw", mapList.get("duty"));
			mapResult.put("jtqx", mapList.get("disruptTypeName"));
			mapResult.put("bzxrdlqk", mapList.get("performance"));
			mapResult.put("ylx", mapList.get("performedPart"));
			mapResult.put("wlx", mapList.get("unperformPart"));
			mapResult.put("nl", mapList.get("age"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理被执行人信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap21(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("bzxrmc", mapList.get("inameClean"));
			mapResult.put("lasj", "长期".equals(String.valueOf(mapList.get("regdateClean"))) ? "2099-01-01"
					: mapList.get("regdateClean"));
			mapResult.put("zxfy", mapList.get("courtName"));
			mapResult.put("zzbd", mapList.get("execMoney"));
			mapResult.put("xb", mapList.get("sexyClean"));
			mapResult.put("ll", mapList.get("ageClean"));
			mapResult.put("sf", mapList.get("areaNameClean"));
			mapResult.put("sfzysfzd", mapList.get("ysfzd"));
			mapResult.put("zxzt", mapList.get("caseState"));
			mapResult.put("ah", mapList.get("casecode"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理股权冻结历史信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap22(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("djwh", mapList.get("frodocno"));
			mapResult.put("djjg", mapList.get("froauth"));
			mapResult.put("djqsrq",
					"长期".equals(String.valueOf(mapList.get("frofrom"))) ? "2099-01-01" : mapList.get("frofrom"));
			mapResult.put("djjzrq",
					"长期".equals(String.valueOf(mapList.get("froto"))) ? "2099-01-01" : mapList.get("froto"));
			mapResult.put("djje", mapList.get("froam"));
			mapResult.put("jdjg", mapList.get("thawauth"));
			mapResult.put("jdwh", mapList.get("thawdocno"));
			mapResult.put("jdrq",
					"长期".equals(String.valueOf(mapList.get("thawdate"))) ? "2099-01-01" : mapList.get("thawdate"));
			mapResult.put("jdsm", mapList.get("thawcomment"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理清算信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap23(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("qszrr", mapList.get("ligentity"));
			mapResult.put("qsfzr", mapList.get("ligprincipal"));
			mapResult.put("qszcy", mapList.get("liqmen"));
			mapResult.put("qswjqk", mapList.get("ligst"));
			mapResult.put("qswjrq",
					"长期".equals(String.valueOf(mapList.get("ligenddate"))) ? "2099-01-01" : mapList.get("ligenddate"));
			mapResult.put("zwcjr", mapList.get("debttranee"));
			mapResult.put("zqcr", mapList.get("claimtranee"));
			mapResult.put("lxdh", mapList.get("tel"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理行政处罚历史信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap24(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("afsj",
					"长期".equals(String.valueOf(mapList.get("casetime"))) ? "2099-01-01" : mapList.get("casetime"));
			mapResult.put("ay", mapList.get("casereason"));
			mapResult.put("az", mapList.get("caseval"));
			mapResult.put("wfxwlx", mapList.get("casetype"));
			mapResult.put("zzlb", mapList.get("exesort"));
			mapResult.put("ajjg", mapList.get("caseresult"));
			mapResult.put("cfjdws", mapList.get("pendecno"));
			mapResult.put("cfjdsqfrq", "长期".equals(String.valueOf(mapList.get("pendecissdate"))) ? "2099-01-01"
					: mapList.get("pendecissdate"));
			mapResult.put("zcxzcfjdjg", mapList.get("penauth"));
			mapResult.put("zywfss", mapList.get("illegfact"));
			mapResult.put("cfyj", mapList.get("penbasis"));
			mapResult.put("cfzl", mapList.get("pentype"));
			mapResult.put("cfjg", mapList.get("penresult"));
			mapResult.put("cfje", mapList.get("penam"));
			mapResult.put("cfzxqk", mapList.get("penexest"));
			mapResult.put("dsrxm", mapList.get("ryname"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理最终控股股东信息数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap25(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("czl", mapList.get("capitalchainex"));
			mapResult.put("czbl", mapList.get("finalratio"));
			mapResult.put("czrq", "长期".equals(String.valueOf(mapList.get("finalcondate"))) ? "2099-01-01"
					: mapList.get("finalcondate"));
			mapResult.put("czfs", mapList.get("finalconform"));
			mapResult.put("sjcz", mapList.get("finalacconam"));
			mapResult.put("cze", mapList.get("finalconam"));
			mapResult.put("czbz", mapList.get("finalcurrency"));
			mapResult.put("rjcz", mapList.get("finalsubconam"));
			mapResult.put("gdlx", mapList.get("finalinvtype"));
			mapResult.put("gb", mapList.get("finalcountry"));
			mapResult.put("zzkggdmc", mapList.get("finalentname"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理税务评级-v2
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap26(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("nsdj", mapList.get("grade"));
			mapResult.put("nf", mapList.get("year"));
			mapResult.put("pjdw", mapList.get("evalDepartment"));
			mapResult.put("lx", mapList.get("type"));
			mapResult.put("nsrsbh", mapList.get("idNumber"));
			mapResult.put("nsrmc", mapList.get("name"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理网站备案-v2
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap27(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("wz", mapList.get("webSite"));
			mapResult.put("jcsj", "长期".equals(String.valueOf(mapList.get("examineDate"))) ? "2099-01-01"
					: mapList.get("examineDate"));
			mapResult.put("gslx", mapList.get("companyType"));
			mapResult.put("wzmc", mapList.get("webName"));
			mapResult.put("xkz", mapList.get("liscense"));
			mapResult.put("gsmc", mapList.get("companyName"));
			mapResult.put("ym", mapList.get("domainName"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理商标信息-v2
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap28(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("lb", mapList.get("intCls"));
			mapResult.put("zt", mapList.get("status"));
			mapResult.put("zch", mapList.get("regNo"));
			mapResult.put("sqr", mapList.get("applicantCn"));
			mapResult.put("sbmc", mapList.get("tmName"));
			mapResult.put("sbzt", mapList.get("category"));
			mapResult.put("sqrq",
					"长期".equals(String.valueOf(mapList.get("appDate"))) ? "2099-01-01" : mapList.get("appDate"));
			mapResult.put("sbtp", mapList.get("tmPic"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理专利-v2数据
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap29(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("zflh", mapList.get("mainCatNum"));
			mapResult.put("sqgbh", mapList.get("applicationPublishNum"));
			mapResult.put("dljg", mapList.get("agency"));
			mapResult.put("fmr", mapList.get("inventor"));
			mapResult.put("dlr", mapList.get("agent"));
			mapResult.put("tplj", mapList.get("imgUrl"));
			mapResult.put("sqhzlh", mapList.get("patentNum"));
			mapResult.put("qbflh", mapList.get("allCatNum"));
			mapResult.put("zlmc", mapList.get("patentName"));
			mapResult.put("zy", mapList.get("abstracts"));
			mapResult.put("dz", mapList.get("address"));
			mapResult.put("sqgbr", "长期".equals(String.valueOf(mapList.get("applicationPublishTime"))) ? "2099-01-01"
					: mapList.get("applicationPublishTime"));
			mapResult.put("sqrq", "长期".equals(String.valueOf(mapList.get("applicationTime"))) ? "2099-01-01"
					: mapList.get("applicationTime"));
			mapResult.put("zllx", mapList.get("patentType"));
			mapResult.put("sqr", mapList.get("applicantName"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 处理欠税公告-v2
	 * 
	 * @param entNameOrEntCode
	 * @param mapList
	 * @return
	 */
	public Map<String, Object> addMap30(String entNameOrEntCode, Map<String, Object> mapList, String tybm) {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		Map<String, Object> mapResult = new HashMap<String, Object>();
		if (!mapList.isEmpty()) {
			mapResult.put("A000001", entNameOrEntCode);
			mapResult.put("A000002", tybm);
			mapResult.put("zjhm", mapList.get("personIdNumber"));
			mapResult.put("frmc", mapList.get("legalpersonName"));
			mapResult.put("jydd", mapList.get("location"));
			mapResult.put("qsjr", mapList.get("newOwnTaxBalance"));
			mapResult.put("nsrmc", mapList.get("name"));
			mapResult.put("qsje", mapList.get("ownTaxBalance"));
			mapResult.put("nsrsbh", mapList.get("taxIdNumber"));
			mapResult.put("lx", mapList.get("type"));
			mapResult.put("qssz", mapList.get("taxCategory"));
			return mapResult;
		}
		return mapList;
	}

	/**
	 * 根据表id获取不同的接口
	 */
	public String selectUrlById(String tableId) {

		String url = "";
		// 企业裁判文书信息
		if ("300002".equals(tableId)) {
			url = qycpwsxx;
		}
		// 企业执行公告信息
		if ("300003".equals(tableId)) {
			url = qyzxggxx;
		}
		// 企业失信公告信息
		if ("300004".equals(tableId)) {
			url = qysxggxx;
		}
		// 企业开庭公告信息
		if ("300005".equals(tableId)) {
			url = qyktggxx;
		}
		// 企业法院公告信息
		if ("300006".equals(tableId)) {
			url = qyfyggxx;
		}
		// 企业网贷黑名单信息
		if ("300007".equals(tableId)) {
			url = qywdhmdxx;
		}
		// 企业案件流程信息
		if ("210102".equals(tableId)) {
			url = qyajlcxx;
		}
		// 企业曝光台信息
		if ("210104".equals(tableId)) {
			url = qybgtxx;
		}
		// 工商基础信息 企业注册信息
		if ("210013".equals(tableId)) {
			url = qyzcxx;
		}
		// 基本信息 企业注册信息
		if ("210110".equals(tableId)) {
			url = qyzcxx;
		}
		// 企业股东及出资信息
		if ("210012".equals(tableId)) {
			url = qygdjczxx;
		}
		// 企业主要管理人员信息
		if ("210011".equals(tableId)) {
			url = qyzyglryxx;
		}
		// 企业法定代表人对外投资信息
		if ("300008".equals(tableId)) {
			url = qyfddbrdwtzxx;
		}
		// 企业法定代表人其他公司任职信息
		if ("210087".equals(tableId)) {
			url = qyfddbrqtgsrzxx;
		}
		// 企业对外投资信息
		if ("300009".equals(tableId)) {
			url = qydwtzxx;
		}
		// 企业信息变更
		if ("210008".equals(tableId)) {
			url = qyxxbg;
		}
		// 分支机构信息
		if ("210009".equals(tableId)) {
			url = fzjdxx;
		}
		// 股权出质历史
		if ("210088".equals(tableId)) {
			url = gqczls;
		}
		// 动产抵押信息
		if ("210091".equals(tableId)) {
			url = dcdyxx;
		}
		// 动产抵押物信息
		if ("210111".equals(tableId)) {
			url = dcdywxx;
		}
		// 失信被执行人信息
		if ("300010".equals(tableId)) {
			url = sxbzxr;
		}

		// 被执行人信息
		if ("300011".equals(tableId)) {
			url = bzxrxx;
		}
		// 股权冻结历史信息
		if ("210093".equals(tableId)) {
			url = gqdjxx;
		}
		// 清算信息
		if ("210094".equals(tableId)) {
			url = qsxx;
		}
		// 行政处罚历史信息
		if ("300012".equals(tableId)) {
			url = xzcflsxx;
		}
		// 最终控股股东信息
		if ("210089".equals(tableId)) {
			url = zzkzgdxx;
		}
		// 税务评级-v2
		if ("300013".equals(tableId)) {
			url = swpj;
		}
		// 网站备案-v2
		if ("300014".equals(tableId)) {
			url = wzba;
		}
		// 商标信息-v2
		if ("300015".equals(tableId)) {
			url = sbxx;
		}
		// 专利-v2
		if ("300016".equals(tableId)) {
			url = zl;
		}
		// 欠税公告-v2
		if ("300017".equals(tableId)) {
			url = qsgg;
		}
		return url;

	}

	private List<Map<String, Object>> addRecordsFromSheet(Sheet st) {

		List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
		List<Map<String, Object>> listDataMap = null;
		int start = 0;
		int end = 1000;
		listDataMap = readExcelData(start, end, st);
		return listDataMap;

	}

	public List<Map<String, Object>> readExcelData(int start, int end, Sheet st) {
		// 第一,二行为标题，不取
		Row row = null;
		int length = 0;
		Map<String, Object> map = null;
		Cell cell = null;
		String value = null;

		String[] cloumn = new String[] { "name", "tybm" };
		length = st.getLastRowNum();

		if (end > length) {
			end = length;
		}
		List<Map<String, Object>> listDataMap = new LinkedList<>();
		for (int rowIndex = start + 1; rowIndex <= end; rowIndex++) {
			row = st.getRow(rowIndex);
			if (row == null) {
				continue;
			}

			short lastCellNum = row.getLastCellNum();

			boolean emptyRow = true;

			for (int cellIndex = 0; cellIndex <= lastCellNum; cellIndex++) {

				if (row.getCell(cellIndex, Row.RETURN_BLANK_AS_NULL) != null) {

					row.getCell(cellIndex).setCellType(HSSFCell.CELL_TYPE_STRING);

					if (!"".equals(row.getCell(cellIndex).getStringCellValue().trim())) {
						{

							emptyRow = false;
							break;
						}
					}

				}
			}

			if (emptyRow) {

				continue;
			}
			map = new HashMap<String, Object>();
			for (int i = 0; i < lastCellNum; i++) {
				value = "";
				cell = row.getCell(i);
				if (cell != null) {
					// 注意：一定要设成这个，否则可能会出现乱码
					switch (cell.getCellType()) {
					case HSSFCell.CELL_TYPE_STRING:
						value = cell.getStringCellValue().trim();
						break;
					case HSSFCell.CELL_TYPE_BLANK:
						break;

					default:
						value = "";
					}
				}
				map.put(cloumn[i], value);
				map.put("rowIndex", rowIndex + 1);
			}
			/* 把数据添加到List里面 */
			listDataMap.add(map);
		}

		return listDataMap;
	}

	public Sheet readExcelFileForSheet(InputStream inputStream) throws IOException {
		Workbook wb = new XSSFWorkbook(inputStream);
		Sheet st = wb.getSheetAt(0);
		wb.close();
		return st;
	}

	/**
	 * 下载模版
	 * 
	 * @param response
	 * @throws IOException
	 */
	@IgnoreAuthority
	@RequestMapping("/export.json")
	public void exportTemplate(HttpServletResponse response) throws IOException {

		FileUtils.downloadFile(this.getClass().getResource("/qymc.xlsx").getPath(), response);

	}

	@RequestMapping(value = "/getCountColums.json")
	public RestServiceResult<List<OptionalColumn>> getCountColums() {
		return new RestServiceResult<List<OptionalColumn>>(YzTestEnum.getOptionalColumns());
	}

	@RequestMapping(value = "/getAdvancedConditionColumns.json")
	public RestServiceResult<List<OptionalColumn>> getAdvancedConditionColumns() {
		return new RestServiceResult<List<OptionalColumn>>(YzTestEnum.getAdvancedConditionColumns());
	}

	/**
	 * ' 获取列表页
	 * 
	 * @param condition
	 * @param page
	 * @param area_id
	 * @param request
	 * @return
	 */
	@IgnoreAuthority
	@RequestMapping(value = "/getTableList.json")
	public RestServiceResult<List<Map<String, Object>>> getTableList(
			@RequestParam(value = "condition", defaultValue = "", required = true) String condition, Page page,
			HttpServletRequest request) {
		RestServiceResult<List<Map<String, Object>>> result = new RestServiceResult<List<Map<String, Object>>>();
		// 获取当前用户信息
		RestServiceResult<SysUser> user = remoteBaseService.getCurrentUser(HttpServletHelper.getUserToken(request));
		SysUser userInfo = null;
		if (RestServiceResult.CODE_SUCCESS == user.getCode()) {
			userInfo = user.getData();
			if (null == userInfo || userInfo.getId() <= 0) {
				result.setCode(RestServiceResult.CODE_UNKNOW);
				result.setMsg("系统异常，请稍后再试！");
				ExceptionLogger.error("GridDistributionController#getTableList", "未获取到当前用户信息！");
				return result;
			}
		} else {
			result.setCode(user.getCode());
			result.setMsg(user.getMsg());
			return result;
		}
		String[] configColumns = (String[]) MapCache.get(userInfo.getId() + "_" + YZTEST);
		List<String> showColumns = (configColumns == null || configColumns.length == 0)
				? YzTestEnum.getDefaultShowColumnEN() : Arrays.asList(configColumns);
		List<Map<String, Object>> data;
		String[] additionalColumns = new String[] { "id", "tableid" };

		data = yzTestService.selectForPage(showColumns, additionalColumns, condition, page);
		result.setData(data);
		result.setCount(page.getTotalCount());

		return result;
	}

	@RequestMapping(value = "/exportLog.json")
	public RestServiceResult<List<Map<String, Object>>> exportData(
			@RequestParam(value = "condition", defaultValue = "", required = true) String condition,
			@RequestParam(value = "columnEN", defaultValue = "", required = true) String columnEN, Page page,
			HttpServletResponse response, HttpServletRequest request) {
		page.setLimit(1000);
		List<String> showColumns = JSONArray.parseArray(columnEN, String.class);
		List<OptionalColumn> optionalColumns = YzTestEnum.getOptionalColumns();
		List<Map<String, Object>> data;
		RestServiceResult<List<Map<String, Object>>> result = new RestServiceResult<List<Map<String, Object>>>();
		// 获取当前用户信息
		RestServiceResult<SysUser> user = remoteBaseService.getCurrentUser(HttpServletHelper.getUserToken(request));
		SysUser userInfo = null;
		if (RestServiceResult.CODE_SUCCESS == user.getCode()) {
			userInfo = user.getData();
			if (null == userInfo || userInfo.getId() <= 0) {
				result.setCode(RestServiceResult.CODE_UNKNOW);
				result.setMsg("系统异常，请稍后再试！");
				ExceptionLogger.error("AchievementController#getAchievementCount", "未获取到当前用户信息！");
				return result;
			}
		} else {
			result.setCode(user.getCode());
			result.setMsg(user.getMsg());
			return result;
		}
		try {
			// String[] additionalColumns = new String[] {
			// "id","grid_id","update_time","area_deptid","case_type"};
			data = yzTestService.selectForPage(showColumns, null, condition, page);
			// 填充部门信息
			// data = dealAchievementData(data, result,
			// HttpServletHelper.getUserToken(request));
			if (RestServiceResult.CODE_SUCCESS != result.getCode()) {
				return result;
			}
			ExcelUtil.downloadExcel(response, data, "扬州接口采集日记", "扬州接口采集日记", showColumns, optionalColumns);
			return result;
		} catch (Exception e) {
			result.setCode(RestServiceResult.CODE_UNKNOW);
			result.setMsg("扬州接口采集日记导出异常，请稍后再试！");
			ExceptionLogger.error("扬州接口采集日记导出异常！", e.getMessage(), e);
			return result;
		}
	}
	
	
	
	
}
